package com.jxwifi.cloud.quickclean.adapter;

import android.graphics.Color;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jxwifi.cloud.quickclean.R;
import com.jxwifi.cloud.quickclean.bean.listBean;

import java.util.List;

public class LogisticsAdapter extends BaseQuickAdapter<listBean, BaseViewHolder> {

    private String mNewTime;

    public LogisticsAdapter(@LayoutRes int layoutResId, @Nullable List data,String mNewTime) {
        super(layoutResId, data);
        this.mNewTime=mNewTime;
    }

    @Override
    protected void convert(BaseViewHolder helper, listBean item) {


        if (mNewTime.equals(item.getTime())) {
            helper.getView(R.id.img_order_details_ball).setBackgroundResource(R.drawable.shap_card_roll_title);
            helper.getView(R.id.vw_order_starts).setBackgroundResource(R.color.color_text5);
            helper.setTextColor(R.id.tv_logistics_process, Color.parseColor("#333333")).setText(R.id.tv_logistics_process, item.getStatus());
            helper.setTextColor(R.id.tv_logistics_time_items, Color.parseColor("#333333")).setText(R.id.tv_logistics_time_items, item.getTime());
        }else{
            helper.getView(R.id.vw_order_starts).setBackgroundResource(R.color.c_k2_d7d7d7);
            helper.getView(R.id.img_order_details_ball).setBackgroundResource(R.drawable.shap_card_roll_title_un);
            helper.setTextColor(R.id.tv_logistics_process, Color.parseColor("#999999")).setText(R.id.tv_logistics_process, item.getStatus());
            helper.setTextColor(R.id.tv_logistics_time_items, Color.parseColor("#999999")).setText(R.id.tv_logistics_time_items, item.getTime());
        }
    }
}
